{% extends 'base.html' %}
{% load helpers %}
{% load form_helpers %}

{% block title %}Create {{ component_type }}{% endblock %}

{% block content %}
    <form action="" method="post" class="h-100 vstack">
        {% csrf_token %}
        <div class="row align-content-start flex-fill">
            <div class="col-lg-6 offset-md-3">
                {% if form.non_field_errors %}
                    <div class="card border-danger">
                        <div class="card-header"><strong>Errors</strong></div>
                        <div class="card-body">
                            {{ form.non_field_errors }}
                        </div>
                    </div>
                {% endif %}
                <div class="card">
                    <div class="card-header">
                        <strong>{{ component_type|bettertitle }}</strong>
                    </div>
                    <div class="card-body">
                        {% render_form form %}
                    </div>
                </div>
                {% include 'inc/extras_features_edit_form_fields.html' with form=model_form %}
            </div>
        </div>

        <div class="nb-form-sticky-footer">
            <button type="submit" name="_create" class="btn btn-primary">
                <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
                -->Create
            </button>
            <button type="submit" name="_addanother" class="btn btn-primary">
                <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
                -->Create and Add More
            </button>
            <a href="{{ return_url }}" class="btn btn-secondary">
                <span aria-hidden="true" class="mdi mdi-close me-4"></span><!--
                -->Cancel
            </a>
        </div>
    </form>
{% endblock %}
